<template>
  <div class="container">
    <div class="descriptions">
      <a-descriptions title="01 方案概述" bordered>
        <a-descriptions-item label="概述" :span="3"> {{ patientReverseScheme.schemeOverview }} </a-descriptions-item>
      </a-descriptions>
      <a-descriptions title="02 控制目标（逆转前）" bordered>
        <!-- <a-descriptions-item label="目标" :span="3"> {{ patientReverseScheme.target.targetName }}</a-descriptions-item> -->
        <a-descriptions-item label="BMI" :span="3"> {{ patientReverseScheme.target.bmi }} </a-descriptions-item>
        <a-descriptions-item label="体重（kg）" :span="3">
          {{ patientReverseScheme.target.weight }}
        </a-descriptions-item>
        <a-descriptions-item label="腰围（cm）" :span="3">
          {{ patientReverseScheme.target.waist }}
        </a-descriptions-item>
        <a-descriptions-item label="糖化血红蛋白(%)" :span="3">
          {{ patientReverseScheme.target.hbA1c }}
        </a-descriptions-item>
        <a-descriptions-item label="空腹血糖（mmol/L）" :span="3">
          {{ patientReverseScheme.target.fbg }}
        </a-descriptions-item>
        <a-descriptions-item label="餐后血糖（mmol/L）" :span="3">
          {{ patientReverseScheme.target.pbg }}
        </a-descriptions-item>
        <a-descriptions-item label="舒张压（mmHg）" :span="3">
          {{ patientReverseScheme.target.pressureLow }}
        </a-descriptions-item>
        <a-descriptions-item label="收缩压（mmHg）" :span="3">
          {{ patientReverseScheme.target.pressureHigh }}
        </a-descriptions-item>
        <a-descriptions-item label="心率/脉搏（次/分钟）" :span="3">
          {{ patientReverseScheme.target.heartRate }}
        </a-descriptions-item>
        <a-descriptions-item label="总胆固醇（mmol/L）" :span="3">
          {{ patientReverseScheme.target.tc }}
        </a-descriptions-item>
        <a-descriptions-item label="甘油三酯（mmol/L）" :span="3">
          {{ patientReverseScheme.target.tg }}
        </a-descriptions-item>
        <a-descriptions-item label="低密度脂蛋白胆固（mmol/L）" :span="3">
          {{ patientReverseScheme.target.ldl }}
        </a-descriptions-item>
        <a-descriptions-item label="高密度脂蛋白胆固（mmol/L）" :span="3">
          {{ patientReverseScheme.target.hdl }}
        </a-descriptions-item>
        <a-descriptions-item label="用药情况" :span="3">
          {{ patientReverseScheme.target.drug == null ? '暂无' : patientReverseScheme.target.drug }}
        </a-descriptions-item>
      </a-descriptions>
      <a-descriptions title="02 控制目标（逆转后）" bordered>
        <!-- <a-descriptions-item label="目标" :span="3"> {{ patientReverseScheme.target.targetName }}</a-descriptions-item> -->
        <a-descriptions-item label="BMI" :span="3"> {{ patientReverseScheme1.target.bmi }} </a-descriptions-item>
        <a-descriptions-item label="体重（kg）" :span="3">
          {{ patientReverseScheme1.target.weight }}
        </a-descriptions-item>
        <a-descriptions-item label="腰围（cm）" :span="3">
          {{ patientReverseScheme1.target.waist }}
        </a-descriptions-item>
        <a-descriptions-item label="糖化血红蛋白(%)" :span="3">
          {{ patientReverseScheme1.target.hbA1c }}
        </a-descriptions-item>
        <a-descriptions-item label="空腹血糖（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.fbg }}
        </a-descriptions-item>
        <a-descriptions-item label="餐后血糖（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.pbg }}
        </a-descriptions-item>
        <a-descriptions-item label="舒张压（mmHg）" :span="3">
          {{ patientReverseScheme1.target.pressureLow }}
        </a-descriptions-item>
        <a-descriptions-item label="收缩压（mmHg）" :span="3">
          {{ patientReverseScheme1.target.pressureHigh }}
        </a-descriptions-item>
        <a-descriptions-item label="心率/脉搏（次/分钟）" :span="3">
          {{ patientReverseScheme1.target.heartRate }}
        </a-descriptions-item>
        <a-descriptions-item label="总胆固醇（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.tc }}
        </a-descriptions-item>
        <a-descriptions-item label="甘油三酯（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.tg }}
        </a-descriptions-item>
        <a-descriptions-item label="低密度脂蛋白胆固（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.ldl }}
        </a-descriptions-item>
        <a-descriptions-item label="高密度脂蛋白胆固（mmol/L）" :span="3">
          {{ patientReverseScheme1.target.hdl }}
        </a-descriptions-item>
        <a-descriptions-item label="用药情况" :span="3">
          {{ patientReverseScheme1.target.drug == null ? '暂无' : patientReverseScheme1.target.drug }}
        </a-descriptions-item>
      </a-descriptions>
      <a-descriptions title="03 打卡计划（逆转前）" bordered>
        <a-descriptions-item
          v-for="item in patientReverseScheme.signPlan"
          key="index"
          :label="item.signinName"
          :span="3"
        >
          {{ item.time }}
        </a-descriptions-item>
        <!-- <a-descriptions-item label="打卡项目" :span="3"> {{ patientReverseScheme.signPlan.time }} </a-descriptions-item>
        <a-descriptions-item label="空腹血糖" :span="3">
          {{ patientReverseScheme.signPlan[0].time }}
        </a-descriptions-item>
        <a-descriptions-item label="早餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[1].time }}
        </a-descriptions-item>
        <a-descriptions-item label="午餐前血糖" :span="3">
          {{ patientReverseScheme.signPlan[2].time }}
        </a-descriptions-item>
        <a-descriptions-item label="午餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[3].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚餐前血糖" :span="3">
          {{ patientReverseScheme.signPlan[4].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[5].time }}
        </a-descriptions-item>
        <a-descriptions-item label="睡前血糖" :span="3">
          {{ patientReverseScheme.signPlan[6].time }}
        </a-descriptions-item>
        <a-descriptions-item label="凌晨血糖" :span="3">
          {{ patientReverseScheme.signPlan[7].time }}
        </a-descriptions-item>
        <a-descriptions-item label="早餐" :span="3"> {{ patientReverseScheme.signPlan[8].time }} </a-descriptions-item>
        <a-descriptions-item label="午餐" :span="3"> {{ patientReverseScheme.signPlan[9].time }} </a-descriptions-item>
        <a-descriptions-item label="晚餐" :span="3"> {{ patientReverseScheme.signPlan[10].time }} </a-descriptions-item>
        <a-descriptions-item label="上午运动" :span="3">
          {{ patientReverseScheme.signPlan[11].time }}
        </a-descriptions-item>
        <a-descriptions-item label="下午运动" :span="3">
          {{ patientReverseScheme.signPlan[12].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚上运动" :span="3">
          {{ patientReverseScheme.signPlan[13].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（早）" :span="3">
          {{ patientReverseScheme.signPlan[14].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（午）" :span="3">
          {{ patientReverseScheme.signPlan[15].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（晚）" :span="3">
          {{ patientReverseScheme.signPlan[16].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（睡前）" :span="3">
          {{ patientReverseScheme.signPlan[17].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（早）" :span="3">
          {{ patientReverseScheme.signPlan[18].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（午）" :span="3">
          {{ patientReverseScheme.signPlan[19].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（晚）" :span="3">
          {{ patientReverseScheme.signPlan[20].time }}
        </a-descriptions-item> -->
      </a-descriptions>
      <a-descriptions title="03 打卡计划（逆转后）" bordered>
        <a-descriptions-item
          v-for="item in patientReverseScheme1.signPlan"
          key="index"
          :label="item.signinName"
          :span="3"
        >
          {{ item.time }}
        </a-descriptions-item>
        <!-- <a-descriptions-item label="打卡项目" :span="3"> {{ patientReverseScheme.signPlan.time }} </a-descriptions-item>
        <a-descriptions-item label="空腹血糖" :span="3">
          {{ patientReverseScheme.signPlan[0].time }}
        </a-descriptions-item>
        <a-descriptions-item label="早餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[1].time }}
        </a-descriptions-item>
        <a-descriptions-item label="午餐前血糖" :span="3">
          {{ patientReverseScheme.signPlan[2].time }}
        </a-descriptions-item>
        <a-descriptions-item label="午餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[3].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚餐前血糖" :span="3">
          {{ patientReverseScheme.signPlan[4].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚餐后血糖" :span="3">
          {{ patientReverseScheme.signPlan[5].time }}
        </a-descriptions-item>
        <a-descriptions-item label="睡前血糖" :span="3">
          {{ patientReverseScheme.signPlan[6].time }}
        </a-descriptions-item>
        <a-descriptions-item label="凌晨血糖" :span="3">
          {{ patientReverseScheme.signPlan[7].time }}
        </a-descriptions-item>
        <a-descriptions-item label="早餐" :span="3"> {{ patientReverseScheme.signPlan[8].time }} </a-descriptions-item>
        <a-descriptions-item label="午餐" :span="3"> {{ patientReverseScheme.signPlan[9].time }} </a-descriptions-item>
        <a-descriptions-item label="晚餐" :span="3"> {{ patientReverseScheme.signPlan[10].time }} </a-descriptions-item>
        <a-descriptions-item label="上午运动" :span="3">
          {{ patientReverseScheme.signPlan[11].time }}
        </a-descriptions-item>
        <a-descriptions-item label="下午运动" :span="3">
          {{ patientReverseScheme.signPlan[12].time }}
        </a-descriptions-item>
        <a-descriptions-item label="晚上运动" :span="3">
          {{ patientReverseScheme.signPlan[13].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（早）" :span="3">
          {{ patientReverseScheme.signPlan[14].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（午）" :span="3">
          {{ patientReverseScheme.signPlan[15].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（晚）" :span="3">
          {{ patientReverseScheme.signPlan[16].time }}
        </a-descriptions-item>
        <a-descriptions-item label="用药（睡前）" :span="3">
          {{ patientReverseScheme.signPlan[17].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（早）" :span="3">
          {{ patientReverseScheme.signPlan[18].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（午）" :span="3">
          {{ patientReverseScheme.signPlan[19].time }}
        </a-descriptions-item>
        <a-descriptions-item label="胰岛素（晚）" :span="3">
          {{ patientReverseScheme.signPlan[20].time }}
        </a-descriptions-item> -->
      </a-descriptions>
    </div>
  </div>
</template>

<script>
import { PAGE_MENU_TYPE } from '@/store/mutation-types'
import { getAction, postAction } from '@/api/manage'
export default {
  name: 'Reverse',
  props: ['first'],
  data() {
    return {
      url: {
        getFirstReport: 'patient/report/first',
        getFinalReport: 'patient/report/summary',
      },
      patientReverseScheme: [],
      patientReverseScheme1: [],
    }
  },
  methods: {
    getFinalReport() {
      let patientId = this.$route.query[PAGE_MENU_TYPE.PatientId]
      let params = {
        patientId: patientId,
      }
      getAction(this.url.getFinalReport, params).then((res) => {
        if (res.success) {
          this.patientReverseScheme1 = res.result.summary.patientReverseScheme
        }
      })
    },
    getFirstReport() {
      let patientId = this.$route.query[PAGE_MENU_TYPE.PatientId]
      let params = {
        patientId: patientId,
      }
      getAction(this.url.getFirstReport, params).then((res) => {
        if (res.success) {
          this.patientReverseScheme = res.result.patientReverseScheme
        }
      })
    },
    onSave() {
      this.$emit('parentOnSave')
    },
    confirm() {
      this.$emit('parentconfirm')
    },
  },
  created() {
    this.getFirstReport()
    this.getFinalReport()
  },
}
</script>

<style scoped>
.container {
  position: relative;
  padding: 1rem;
}
/deep/.ant-descriptions-title {
  margin-top: 20px;
  text-align: center;
}
/deep/.descriptions .ant-descriptions-item-colon {
  width: 300px;
  text-align: center;
}
/* .descriptions .ant-descriptions-item-content {
  text-align: center;
} */
</style>
